package com.emep.emeptime.entity.systeminfo;


import lombok.Data;
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;
import java.io.Serializable;
import java.util.HashSet;
import java.util.Set;

/**
* @author Wangcc
* @Description: 角色信息表
* @date 2018/2/23 17:21
* @version V1.0
*/
@Data
@Entity
@Table(name = "sys_role_info")
public class SysRoleInfo implements Serializable {

    private static final long serialVersionUID = 5537893713006751534L;

    @Id
    @GenericGenerator(name = "system-uuid", strategy = "uuid")
    @GeneratedValue(generator = "system-uuid")
    private String id;
    @Column(name = "role_name",columnDefinition="varchar(100) COMMENT '角色名称'")
    private String roleName;
    @Column(name = "description",columnDefinition="varchar(100) COMMENT '描述'")
    private String description;


    @ManyToMany(cascade = CascadeType.PERSIST, fetch = FetchType.LAZY)
    @JoinTable(name = "role_menu",
            joinColumns = { @JoinColumn(name = "role_id") },
            inverseJoinColumns = {@JoinColumn(name = "menu_id") })
    private Set<SysMenuInfo> sysMenuInfos = new HashSet<SysMenuInfo>(0);

    public SysRoleInfo() {
    }
}
